﻿@using ZBJF.Warranty.BLL
@using ZBJF.Warranty.Common.Enums
@using ZBJF.Warranty.WebProvider
@model ZBJF.Warranty.Model.PageMenu
@{
    var id = Model != null ? Model.ID : 0;
    var parentPageMenuName = "";
    if (Model != null && Model.ParentID > 0)
    {
        parentPageMenuName = ServiceFactory.PageMenuServiceInstance.Load(Model.ParentID).PageName;
    }
}
@using (Html.BeginForm("Save", "PageMenu", FormMethod.Post, new { @class = "form-horizontal" }))
{
    <fieldset>
        @Html.HiddenFor(m => m.ID)
        <div class="control-group">
            <label class="control-label">页面名称:</label>
            <div class="controls">
                @Html.TextBoxFor(m => m.PageName, new { @class = "col-sm-8", validate = "{required:true,messages:{required:'请输入页面名称'}}" })
                @Html.ValidationMessageFor(m => m.PageName)
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">所属系统:</label>
            <div class="controls">
                @Html.DropDownListFor(m => m.BelongApplicationType, ConvertToSelector.Instance.EnumTypeConvertToSelectList(typeof(ApplicationType)), new { validate = "{required:true,messages:{required:'请选择所属系统'}}" })
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">父级菜单:</label>
            <div class="controls" id="PidSelect">
                @Html.TextBox("ParentPageMenuName", parentPageMenuName, new { @readonly = "readonly", @class = "select-icon", onclick = "showLayerOpen('选择父级菜单','/PubModelDialog/PageMenuSelector?chkStyle=radio&textid=ParentPageMenuName&hiddenId=ParentID','420px','90%')" })
                @Html.HiddenFor(m => m.ParentID)
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">页面路径:</label>
            <div class="controls">
                @Html.TextBoxFor(m => m.PageUrl, new { @class = "col-sm-8" })
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">排序:</label>
            <div class="controls">
                @Html.TextBoxFor(m => m.OrderIndex, new { @class = "col-sm-8", onkeyup = "onlyInputInt(this)", validate = "{required:true,digits:true,messages:{required:'请输入排序数字'}}" })
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">页面图标:</label>
            <div class="controls">
                @Html.TextBoxFor(m => m.IcoClass, new { @class = "col-sm-8" })
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">是否显示为左侧菜单</label>
            <div class="controls">
                <label> @Html.RadioButtonFor(m => m.IsShow, "true", new { @name = "IsShow" }) 是</label>
                <label> @Html.RadioButtonFor(m => m.IsShow, "false", new { @name = "IsShow" })  否</label>
            </div>
        </div>
    </fieldset>
    <div class="control-group">
        <div class="align-center">
            <button class="btn btn-primary Edit-R" type="submit">
                <i class="icon-ok bigger-110"></i>
                保存
            </button>
            <button class="btn" type="reset" data-dismiss="modal" onclick="parent.layer.closeAll()">
                <i class="icon-undo bigger-110"></i>
                取消
            </button>
        </div>
    </div>
}